<template>
	
	<div>
		<el-card class="box-card">
			<div>人员密集场智慧云平台 机构选择功能中心</div>
		</el-card>
		<div class="home">
		  <div class="module-wrapper">
		    <el-row :gutter="30" type="flex" justify="center">
		      <el-col :span="6" v-for="(item, index) in modules.slice(0,3)" :key="index">
		        <el-card class="module-card" :body-style="{ padding: '0px' }" @click.native="handleModuleClick(item)">
		          <div class="module-content">
		            <i :class="item.icon"></i>
		            <h3>{{ item.title }}</h3>
		            <p>{{ item.description }}</p>
		          </div>
		        </el-card>
		      </el-col>
		    </el-row>
		    <el-row :gutter="30" type="flex" justify="center">
		      <el-col :span="6" v-for="(item, index) in modules.slice(3,6)" :key="index+3">
		        <el-card class="module-card" :body-style="{ padding: '0px' }" @click.native="handleModuleClick(item)">
		          <div class="module-content">
		            <i :class="item.icon"></i>
		            <h3>{{ item.title }}</h3>
		            <p>{{ item.description }}</p>
		          </div>
		        </el-card>
		      </el-col>
		    </el-row>
		    <el-row :gutter="30" type="flex" justify="center">
		      <el-col :span="6" v-for="(item, index) in modules.slice(6,9)" :key="index+6">
		        <el-card class="module-card" :body-style="{ padding: '0px' }" @click.native="handleModuleClick(item)">
		          <div class="module-content">
		            <i :class="item.icon"></i>
		            <h3>{{ item.title }}</h3>
		            <p>{{ item.description }}</p>
		          </div>
		        </el-card>
		      </el-col>
		    </el-row>
		  </div>
		</div>
	</div>

</template>

<script>
export default {
  name: 'Home',
  data() {
    return {
      modules: [
        {
          title: 'XX县第一中学',
          description: '学校、培训机构管理系统',
          icon: 'el-icon-reading',
          path: '/education'
        },
        {
          title: 'XX县第一中学',
          description: '医院、诊所管理系统',
          icon: 'el-icon-first-aid-kit',
          path: '/medical'
        },
        {
          title: 'XX县第一中学',
          description: '民政服务管理平台',
          icon: 'el-icon-office-building',
          path: '/civil'
        },
        {
          title: 'XX县第一中学',
          description: '文化体育场所管理',
          icon: 'el-icon-basketball',
          path: '/culture'
        },
        {
          title: 'XX县第一中学',
          description: '商场、市场管理系统',
          icon: 'el-icon-shopping-bag-1',
          path: '/business'
        },
        {
          title: 'XX县第一中学',
          description: '餐饮企业管理平台',
          icon: 'el-icon-dish',
          path: '/restaurant'
        },
      ]
    }
  },
  methods: {
    handleModuleClick(module) {
      this.$router.push(module.path)
    }
  }
}
</script>

<style scoped>
.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f7fa;
  padding: 20px;
  margin-top: -200px;
}

.module-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: auto;
}

.el-row {
  margin-bottom: 30px;
}

.el-row:last-child {
  margin-bottom: 0;
}

.module-card {
  height: 200px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.module-content {
  padding: 20px;
  text-align: center;
  width: 100%;
}

.module-content i {
  font-size: 48px;
  color: #409EFF;
  margin-bottom: 15px;
}

.module-content h3 {
  margin: 10px 0;
  font-size: 18px;
  color: #303133;
}

.module-content p {
  color: #909399;
  font-size: 14px;
  margin: 0;
}

@media screen and (max-width: 768px) {
  .el-col {
    width: 100% !important;
  }
  
  .module-card {
    height: 150px;
  }
}
</style>